import request from '@/config/axios'

// 市售产品停产清单汇总 VO
export interface ProductMarketDiscontinuedVO {
  id: number // 序号
  productName: string // 产品名称
  productModel: string // 产品型号
  discontinuationReason: string // 停产原因
  discontinuationTime: Date // 停产时间
  notifier: string // 停产告知人
  remarks: string // 备注
}

// 市售产品停产清单汇总 API
export const ProductMarketDiscontinuedApi = {
  // 查询市售产品停产清单汇总分页
  getProductMarketDiscontinuedPage: async (params: any) => {
    return await request.get({ url: `/om/product-market-discontinued/page`, params })
  },

  // 查询市售产品停产清单汇总详情
  getProductMarketDiscontinued: async (id: number) => {
    return await request.get({ url: `/om/product-market-discontinued/get?id=` + id })
  },

  // 新增市售产品停产清单汇总
  createProductMarketDiscontinued: async (data: ProductMarketDiscontinuedVO) => {
    return await request.post({ url: `/om/product-market-discontinued/create`, data })
  },

  // 修改市售产品停产清单汇总
  updateProductMarketDiscontinued: async (data: ProductMarketDiscontinuedVO) => {
    return await request.put({ url: `/om/product-market-discontinued/update`, data })
  },

  // 删除市售产品停产清单汇总
  deleteProductMarketDiscontinued: async (id: number) => {
    return await request.delete({ url: `/om/product-market-discontinued/delete?id=` + id })
  },

  // 导出市售产品停产清单汇总 Excel
  exportProductMarketDiscontinued: async (params) => {
    return await request.download({ url: `/om/product-market-discontinued/export-excel`, params })
  },
}